<h1>Administration</h1>

<style type="text/css">
.permission_action {
  font-size: 80%; 
  text-transform: uppercase; 
  text-decoration: none;
  color: #444;
  background-color: #ffc;
}
</style>

<h2>Base permissions</h2>

<blockquote>Base permissions apply to all objects of a particular type.  If you grant someone base permissions on a type of object, they will be able to perform that action on any object of that type.  Please choose the type of object you want to change the permissions for:</blockquote>

<ul>
  <% @pclasses.each do |pc| -%>
    <li>
      <%= link_to pc.name.pluralize.humanize, :action => "edit", :klass => pc.name %>
    </li>
  <% end -%>
</ul>

<h2>Roles</h2>

<blockquote>Roles are groups of people.  Roles can be given permissions just as if they were people.  This can be convenient for assigning permissions to large groups of people at once.  Please choose the role you want to edit:</blockquote>

<ul>
  <% @roles.each do |role| -%>
    <li id="role_<%= role.id%>">
      <%= link_to role.name, :action => "edit_role", :id => role.id %>
      <%= link_to_remote "Delete",
            { :url => { :controller => "permission", :action => "delete_role", :id => role.id },
            :success => "$('role_#{role.id}').remove();",
            :confirm => "Are you sure you want to delete that role?" },
            { :class => "permission_action" } %>
    </li>
  <% end -%>
</ul>

<% form_for :role, @role, :url => {:action => "create_role"} do |f| %>
  New role: <%= f.text_field "name" %>
  <%= submit_tag "Create" %>
<% end %>